<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>EditCondition</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<STYLE> .menu{font:menu}
</STYLE>
</HEAD>
<SCRIPT language="javascript" src="/include/common.js"></SCRIPT>
<SCRIPT language="javascript" src="/include/SOAP.js"></SCRIPT>
<body MS_POSITIONING="GridLayout" style="MARGIN: 0px; BACKGROUND-COLOR: buttonface" id="ws">
<SCRIPT language="javascript">initWS("GLRules","GLRules.asmx")</SCRIPT>
<TABLE width="100%" style="FONT: menu">
	<TR>
		<TD colspan="10">
	Field Name
	<TR>
		<TD colspan="10">
			<SELECT id="selFieldEdit" size="10" style="WIDTH:100%" datasrc="#xmlFields" datafld="ID"
				class="Menu" onchange="doSelectField(this)">
				<ASP:LITERAL ID="ltrFields" Runat="server"></ASP:LITERAL>
			</SELECT>
	<TR>
		<TH>
			Lable<TH>Units<TH style="DISPLAY:none">Check
					<TR>
						<TH width="100%">
							<INPUT style="WIDTH:100%" id="txtFieldLable" datasrc="#xmlFields" datafld="Lable" class="Menu">
							<TH>
								<SELECT id="selFieldUnit" runat="server" datasrc="#xmlFields" datafld="Units" class="Menu">
								</SELECT>
								<TH width="100%" style="DISPLAY:none">
									<INPUT id="chkInclude" type="checkbox">
									<TR>
										<TD colspan="10">
									Description
									<TR>
										<TH colspan="10">
											<TEXTAREA style="OVERFLOW:hidden;WIDTH:100%;HEIGHT:100%" class="Menu" id="txaFieldDesc" datasrc="#xmlFields"
												datafld="Description"></TEXTAREA>
											<TR>
												<TD colspan="10">
													Reject Message
												</TD>
											</TR>
											<TR>
												<TD colspan="10">
													<TEXTAREA style="OVERFLOW:hidden;WIDTH:100%;HEIGHT:100%" class="Menu" id="txaMessage" datasrc="#xmlFields"
														datafld="RejectMessage"></TEXTAREA>
												</TD>
											</TR>
</TABLE>
<INPUT type="button" value=" Save" onclick="saveFieldDesc()"> <INPUT type="button" value="Close" onclick="close()">
<XML id="xmlFields">
	<ASP:LITERAL ID="ltrXml" Runat="server">
		<TABLE ID="" FieldName="" Lable="" Description="" Units="" RejectMessage="" />
	</ASP:LITERAL>
</XML>
<SCRIPT language="javascript">
function doSelectField(){
	var sel = selFieldEdit;
	var rs = xmlFields.recordset;
	rs("ID").value = selFieldEdit.value;
	rs("Units").value = unescape(getSELAttr(sel,'units'));
	rs("Lable").value = unescape(getSELAttr(sel,'lable'));
	rs("Description").value = unescape(getSELAttr(sel,'desc'));
	rs("RejectMessage").value=unescape(getSELAttr(sel,'message'));
}
function saveFieldDesc(){
	var ret = WS(CO("UpdateFieldDesc"),xmlFields);
	if( showSOAPError(ret) )return;
	var rs = xmlFields.recordset;
	rs("ID").value = ret.value;
	_setAttr('units');
	_setAttr('lable');
	_setAttr('desc',"Description");
	_setAttr('message',"Rejectmessage");
	// Local
	function _setAttr(attrName,fieldName){
		setSELAttr(selFieldEdit,attrName,escape(rs(fieldName||attrName).value));
	}
}
function getSELText(sel){return getSELAttr(sel,"text")}
function getSELAttr(sel,attrName){return sel.selectedIndex>=0?sel[sel.selectedIndex][attrName]:null}
function setSELAttr(sel,attrName,value){sel[sel.selectedIndex][attrName]=value}
		</SCRIPT>
	</body>
</HTML>
